summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/vendors/[id]/info/layout.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-03-26 00:37:41 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-03-26 00:37:41 +0000
commite0dfb55c5457aec489fc084c4567e791b4c65eb1 (patch)
tree68543a65d88f5afb3a0202925804103daa91bc6f /app/[lng]/evcp/vendors/[id]/info/layout.tsx
3/25 까지의 대표님 작업사항
Diffstat (limited to 'app/[lng]/evcp/vendors/[id]/info/layout.tsx')
-rw-r--r--app/[lng]/evcp/vendors/[id]/info/layout.tsx79
1 files changed, 79 insertions, 0 deletions
diff --git a/app/[lng]/evcp/vendors/[id]/info/layout.tsx b/app/[lng]/evcp/vendors/[id]/info/layout.tsx
new file mode 100644
index 00000000..39e0bac0
--- /dev/null
+++ b/app/[lng]/evcp/vendors/[id]/info/layout.tsx
@@ -0,0 +1,79 @@
+import { Metadata } from "next"
+
+import { Separator } from "@/components/ui/separator"
+import { SidebarNav } from "@/components/layout/sidebar-nav"
+import { findVendorById } from "@/lib/vendors/service" // 가정: 여기에 findVendorById가 있다고 가정
+import { Vendor } from "@/db/schema/vendors"
+
+export const metadata: Metadata = {
+ title: "Vendor Detail",
+}
+
+export default async function SettingsLayout({
+ children,
+ params,
+}: {
+ children: React.ReactNode
+ params: { lng: string , id: string}
+}) {
+
+ // 1) URL 파라미터에서 id 추출, Number로 변환
+ const resolvedParams = await params
+ const lng = resolvedParams.lng
+ const id = resolvedParams.id
+
+ const idAsNumber = Number(id)
+ // 2) DB에서 해당 벤더 정보 조회
+ const vendor: Vendor | null = await findVendorById(idAsNumber)
+
+ // 3) 사이드바 메뉴
+ const sidebarNavItems = [
+ {
+ title: "Contacts",
+ href: `/${lng}/evcp/vendors/${id}/info`,
+ },
+ {
+ title: "Items",
+ href: `/${lng}/evcp/vendors/${id}/info/items`,
+ },
+ {
+ title: "RFQ History",
+ href: `/${lng}/evcp/vendors/${id}/info/rfq-history`,
+ },
+ {
+ title: "Bidding History",
+ href: `/${lng}/evcp/vendors/${id}/info/bid-history`,
+ },
+ {
+ title: "Contract History",
+ href: `/${lng}/evcp/vendors/${id}/info/contract-history`,
+ },
+ ]
+
+ return (
+ <>
+ <div className="container py-6">
+ <section className="overflow-hidden rounded-[0.5rem] border bg-background shadow">
+ <div className="hidden space-y-6 p-10 pb-16 md:block">
+ <div className="space-y-0.5">
+ {/* 4) 벤더 정보가 있으면 코드 + 이름 + "상세 정보" 표기 */}
+ <h2 className="text-2xl font-bold tracking-tight">
+ {vendor
+ ? `${vendor.vendorCode ?? ""} - ${vendor.vendorName} 상세 정보`
+ : "Loading Vendor..."}
+ </h2>
+ <p className="text-muted-foreground">벤더 관련 상세사항을 확인하세요.</p>
+ </div>
+ <Separator className="my-6" />
+ <div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0">
+ <aside className="-mx-4 lg:w-1/5">
+ <SidebarNav items={sidebarNavItems} />
+ </aside>
+ <div className="flex-1">{children}</div>
+ </div>
+ </div>
+ </section>
+ </div>
+ </>
+ )
+} \ No newline at end of file